package query_understanding.common.nlp_toolkit;


import edu.stanford.nlp.ling.IndexedWord;
import edu.stanford.nlp.semgraph.SemanticGraphEdge;
import javafx.util.Pair;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by julianzliu on 4/24/2017.
 */
public class RelationPath {

    public IndexedWord startNode;

    //public List<SemanticGraphEdge> edgeList;
    //public List<IndexedWord> indexedWordList;
    public List<Pair<SemanticGraphEdge, IndexedWord>> path;

    public RelationPath(){
        //this.edgeList = new ArrayList<>();
        //this.indexedWordList = new ArrayList<>();
        this.path = new ArrayList<>();
    }

    @Override
    public String toString(){
        String path_str = "";
        path_str += startNode;
        for(Pair<SemanticGraphEdge, IndexedWord> pair: path){
            path_str += " --" + pair.getKey().getRelation() + "--> " + pair.getValue();
        }
        return path_str;
    }
}
